GtkTextHandle: position handles properly
authorMatthias Clasen <mclasen@redhat.com>
Tue, 9 Jun 2015 21:06:27 +0000 (17:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 9 Jun 2015 21:06:27 +0000 (17:06 -0400)
Move the handles so that the asymmetric assets align with the
start/end of the selection.

gtk/gtktexthandle.c

index c816ff2f454cf444be08e74333749f0faee57b4b..e3c9854fc85679bf87fbcbfa1d1eecc96b95055f 100644 (file)
@@ -387,15 +387,19 @@ _gtk_text_handle_update (GtkTextHandle         *handle,
                                         rect.x, rect.y, &rect.x, &rect.y);
 
       if (pos == GTK_TEXT_HANDLE_POSITION_CURSOR)
-        handle_pos = GTK_POS_BOTTOM;
+        {
+          handle_pos = GTK_POS_BOTTOM;
+          if (priv->mode == GTK_TEXT_HANDLE_MODE_CURSOR)
+            rect.x -= rect.width / 2;
+        }
       else
         {
           handle_pos = GTK_POS_TOP;
           rect.y += handle_window->pointing_to.height;
+          rect.x -= rect.width;
         }
 
       height += handle_window->pointing_to.height;
-      rect.x -= rect.width / 2;
 
       gtk_widget_set_size_request (handle_window->widget, width, height);
       gtk_widget_show (handle_window->widget);